<?php

$data = file_get_contents("https://www.jb51.net/article/151901.htm");

$data = mb_convert_encoding($data, "UTF-8", "GBK");

$preg = "/<h1 class=\"YaHei\">(.+?)<\/h1>/";

$preg = "/<div id=\"content\">(.+?)<\/div><!--endmain-->/s";


$c = preg_match_all($preg,$data,$out);


// var_dump($c,$out);

echo $out[1][0];